import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/console/login',
    method: 'post',
    data
  })
}

export function getRole() {
  return request({
    url: '/role/menu',
    method: 'post'
  })
}

export function changePwd(data) {
  return request({
    url: '/console/user/updatePassword',
    method: 'post',
    data
  })
}

export function getSysUser(data) {
  return request({
    url: '/console/user/page',
    method: 'post',
    data
  })
}

export function getSysUserDetail(data) {
  return request({
    url: '/console/user/' + data,
    method: 'get'
  })
}

export function addSysUser(data) {
  return request({
    url: '/console/user/add',
    method: 'post',
    data
  })
}
export function editSysUser(data) {
  return request({
    url: '/console/user/update',
    method: 'post',
    data
  })
}

export function deleteSysUser(data) {
  return request({
    url: '/console/user/delete/' + data,
    method: 'post'
  })
}

export function resetPassword(data) {
  return request({
    url: '/console/user/resetPassword/' + data,
    method: 'post'
  })
}
